/*
 *               ____
 *              /\   \
 *             ___\   \___
 *            /\          \
 *            \ \___    ___\
 *        ____ \/__/\   \__/
 *       /\   \    \ \___\    klof  |  innovative web technology
 *      ___\   \___ \/___/
 *     /\          \          klib3/addon/movement.js
 *     \ \___    ___\         Library of movement functions
 *      \/__/\   \__/
 *          \ \___\           Copyright 2003-2006, klof
 *           \/___/           http://www.klof.net/k.lib3/
 *
 */

/* Create the master klib3 object if she doesn't exist */
if ( typeof klib3 != "object" )
	klib3 = new ( function(){ this._child = 0 } )();

klib3.movement = function( mElement )
{
	this._version = "1.0.0";
};
klib3.movement.prototype.smooth = function( nBegin, nEnd, nStep, nNumStep )
{
	return ( nEnd - nBegin ) / 2 * ( ( nStep /= nNumStep / 2 ) < 1 ? Math.pow( nStep, 3 ) : ( nStep -= 2 ) * Math.pow( nStep, 2 ) + 2 ) + nBegin;
};
klib3.movement.prototype.elastic = function( nBegin, nEnd, nStep, nNumStep )
{
	return ( nEnd - nBegin ) * ( ( nStep = nStep / nNumStep - 1 ) * nStep * ( ( ( Math.PI / 3 ) + 1 ) * nStep + ( Math.PI / 3 ) ) + 1) + nBegin;
};

// construct the klib3.movement Object onto itself so we have access to it's members
klib3.movement = new klib3.movement;
